import {Component} from 'react';
import {Breadcrumb} from 'antd';
import {connect} from 'dva';
// 头部导航下面栏部分
class HeadSonNav extends Component {
  constructor (props) {
    super (props);
  }
  render () {
    const thisRoute = this.props.gData.thisRoute;
    return (
      <Breadcrumb separator=">" style={{margin: '16px 0'}}>
        {thisRoute.length > 1
          ? thisRoute.map ((item, index) => {
              return (
                <Breadcrumb.Item key={index}>
                  <a href={item.path}>
                    {item.title}
                  </a>
                </Breadcrumb.Item>
              );
            })
          : ''}
      </Breadcrumb>
    );
  }
}
const mapStateToProps = state => {
  return {gData: state.gData};
};

export default connect (mapStateToProps) (HeadSonNav);
